
package com.bcurtu.ejb;

import java.util.Date;

import javax.ejb.CreateException;

import org.springframework.ejb.support.AbstractStatelessSessionBean;

import com.bcurtu.db.Account;
import com.bcurtu.service.TempAliasService;

public class TempAliasServiceEjb extends AbstractStatelessSessionBean implements
		TempAliasService {

	private TempAliasService service;

	public boolean blockAccountByAlias(String alias) {
		return service.blockAccountByAlias(alias);
	}

	public int blockAccounts(Date date) {
		return service.blockAccounts(date);
	}

	public boolean createAccount(String alias, String forward, Integer minutes) {
		return service.createAccount(alias,forward,minutes);
	}

	public boolean deleteAccountByAlias(String alias) {
		return service.deleteAccountByAlias(alias);
	}

	public int deleteExpiredAccounts(Date date) {
		return service.deleteExpiredAccounts(date);
	}

	public void extendAccount(Account acc, Integer minutes) {
		service.extendAccount(acc,minutes);
		
	}

	public Account getAccountByAliasAndForward(String alias, String forward) {
		return service.getAccountByAliasAndForward(alias,forward);
	}

	public boolean isValidAlias(String alias) {
		return service.isValidAlias(alias);
	}

	@Override
	protected void onEjbCreate() throws CreateException {
		service = (TempAliasService) getBeanFactory().getBean("BusinessService");
		
	}
	
	
}
